// 请求接口
import { getList,inventoryOfStore} from '@/api/inventory'

import Qs from 'qs'



const state = {}

const mutations = {}

const actions = {

  // 获取库存列表信息
  async getList({commit},serchForm) {
    let res = await getList(serchForm);
    return res
  },
  // 获取库存列表信息
  async inventoryOfStore({commit},serchForm) {
   let {stoId,time} = serchForm
   console.log(stoId);
   console.log(time);
  //  console.log("aa   aaa aaa ");
   let res ;
      if(time.length > 1) {
          res = await inventoryOfStore({store:{id: stoId},createTime:time[0],updateTime:time[1]});
      }else{
          res = await inventoryOfStore({store:{id: stoId}});
      }
      console.log(res);
    return res
  },

  
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}

